package cn.csg.iotplatform.module.system.manufacturer;

import cn.csg.iotplatform.framework.common.pojo.CommonResult;
import cn.csg.iotplatform.module.system.enums.ApiConstants;
import cn.csg.iotplatform.module.system.manufacturer.dto.ManufacturerRespDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


/**
 * @Author Andy
 * @Date 2024/4/7
 */
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
@Tag(name = "RPC 服务 - 厂商")
public interface ManufacturerApi {

    String PREFIX = ApiConstants.PREFIX + "/manufacturer";

    @GetMapping(PREFIX + "/getDeviceManufacturerByName")
    @Operation(summary = "根据厂商名称获得厂商信息")
    @Parameter(name = "name", description = "厂商名称", example = "1233", required = true)
    CommonResult<ManufacturerRespDTO> getDeviceManufacturerByName(@RequestParam("name") String name);

    @GetMapping(PREFIX + "/getDeviceManufacturerByIdAysnVersion")
    @Operation(summary = "根据厂商ID获得厂商信息")
    @Parameter(name = "id", description = "厂商id", example = "1233", required = true)
    CommonResult<ManufacturerRespDTO> getDeviceManufacturerByIdAsynVersion(@RequestParam("id") String id, @RequestHeader("Authorization") String authorization);

    @GetMapping(PREFIX + "/getDeviceManufacturer")
    @Operation(summary = "获得厂商信息")
    CommonResult<List<ManufacturerRespDTO>> getDeviceManufacturer();

}
